import { Injectable } from "@angular/core";

import atob from "atob";
// import btoa from "btoa";
const base64url = require("base64-url");

@Injectable({
  providedIn: "root"
})
export class Base64Service {
  constructor() {}

  encode(str: string) {
    return str;
  }

  decode(b64: string) {
    return b64;
  }

  unescape(str: string) {
    return base64url.unescape(str);
  }

  escape(str: string) {
    return base64url.escape(str);
  }
}
